<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Get请求练习</title>
	</head>
	<body>
		<h1>ajax作业</h1>
		<script src="../js/axios.js"></script>
		<script>
			/**
			 * 作业1：根据ID查询用户信息
			 * 作业2：根据age/sex查询用户信息
			 * */
			 let url = 'http://localhost:9000/ajax/findById?id=1'
			 axios.get(url)
				  .then(function(promise){
					  console.log(promise.data)
				  })
				  
			 let url2 = 'http://localhost:9000/ajax/findByAS'
			 let user = {
				 age: 100,
				 sex: '男'
			 }
			 axios.get(url2,{params : user})
				  .then(function(promise){
					  console.log(promise.data)
				  })
		</script>
	</body>
</html>
